package com.pai.test;
import java.net.DatagramPacket;  
import java.net.InetAddress;  
import java.net.MulticastSocket;  
/** 
 *  
 * 广播发送端 
 
 */  
public class BroadCastSend  
{  
  
      /** 
       * @param args 
       * @throws UException  
       */  
      public static void main ( String [] args ) throws Exception  
      {  
            int port = 10886;  
             String sendMessage="xixi";  
            InetAddress inetAddress = InetAddress.getByName("228.10.10.10");  
            DatagramPacket datagramPacket = new DatagramPacket(sendMessage.getBytes(), sendMessage.length(), inetAddress, port);  
            MulticastSocket multicastSocket = new MulticastSocket();  
            multicastSocket.send(datagramPacket);  
            multicastSocket.close();
      }  
  
}  